package org.reliablesource.pleiades;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;

/**
 * @since 1.0
 * 
 */
public class HighlightSelectedAnnotations implements IObjectActionDelegate {

	IWorkbenchPart targetPart;
	ISelection currentSelection;

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
	 *      org.eclipse.ui.IWorkbenchPart)
	 */
	public void setActivePart(IAction _action, IWorkbenchPart _targetPart) {
		targetPart = _targetPart;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
	 */
	public void run(IAction _action) {
		IViewReference[] refs = PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getViewReferences();
		int _nViews = refs.length;
		for (int i = 0; i < _nViews; i++) {
			if (refs[i].getId().equals(
					"org.reliablesource.pleiades.view.browser")) {
				// ((BrowserView)refs[i].getPart(true)).get
			}
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
	 *      org.eclipse.jface.viewers.ISelection)
	 */
	public void selectionChanged(IAction _action, ISelection _selection) {
		currentSelection = _selection;
	}

}
